package com.tensquare.base.controller;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

/**
 * Created by Administrator on 2021/6/30.
 */
//自定义读取配置信息,
@RestController
@RefreshScope   //此注解用于刷新配置  想要读取配置文件信息需要 调用http://127.0.0.1:12000/actuator/bus-refresh
public class TestController {

    @Value("${sms.ip}")
    private String ip;

    public String getIp() {
        return ip;
    }

    public void setIp(String ip) {
        this.ip = ip;
    }
    @RequestMapping(value="ip",method = RequestMethod.GET)
    public String ip(){
        return ip;
    }
}
